set(MODULE_NAME tetgen)
set(ENABLE_LIBRARY 0)

set(MODULE_SOURCES 
    tetgen/tetgen.h 
    tetgen/tetgen.cxx 
    tetgen/predicates.cxx 
    tetgenext.cxx
    tetgenext.h
    tgdefines.h
    base64.h
)

set(MODULE_SOURCES ${MODULE_SOURCES}
   ./json/jsoncpp.cpp
)

if(MSVC)
  add_definitions(-D_CRT_SECURE_NO_WARNINGS)
endif()

include_directories(./)
include_directories(./tetgen)

if(ENABLE_LIBRARY)
  add_definitions(-DTETLIBRARY)
  add_library(${MODULE_NAME} STATIC ${MODULE_SOURCES} )
  set_static_lib()
else()
  add_executable(${MODULE_NAME} ${MODULE_SOURCES})
endif()

if(MSVC)
  set_target_properties(${MODULE_NAME} PROPERTIES COMPILE_FLAGS "/bigobj")
else()
  set_target_properties(${MODULE_NAME} PROPERTIES COMPILE_FLAGS "-std=c++11")
endif()

